Release 10.1A: OpenEdge Development:
Progress 4GL Reference
{ } Argument reference
References the value of an argument that a procedure passes to a called external procedure file or to an include file.
Progress converts each argument to a character format. This conversion removes the surrounding double-quotes if the parameter was specified as a character string constant in the RUN statement or include file reference.
When one procedure is called from another and arguments are used, Progress recompiles the called procedure, substituting the arguments that the calling procedure passes, and then runs the called procedure.
Syntax
Enter the braces ({}) as shown; they do not represent syntax notation in this description.
nThe number of the argument being referred to. If
n= 0, Progress substitutes the name of the current procedure (the name you used when you called it, not the full pathname) as the argument. Ifn= *, Progress substitutes all arguments that the calling procedure passes (but not the name {0}). If you refer to thenth parameter and the calling procedure does not supply it, {n} is ignored.&argument-nameThe name of the argument being referred to. If you refer to an
argument-nameand the calling procedure does not supply it, Progress ignores {&argument-name}.If
Note: It is invalid to pass both numbered and named arguments within a single pair of braces. Although this will not cause a compile-time or run-time error, the arguments will not be passed correctly. Examplesargument-nameis an asterisk (*), Progress substitutes all arguments that the calling procedure passes. It also adds quotation marks to each parameter, so you can pass the named argument list through multiple levels of include files.The procedure
r-arg.pruns procedurer-arg2.p, passing the arguments customer and name tor-arg2.p. Progress substitutes these arguments for {1} and {2} in ther-arg2.pprocedure:
The
r-inc.pprocedure defines the variablestxtandnum, and assigns the values Progress VERSION and 7 to them. Ther-inc.pprocedure includes ther-inc.ifile and passes the&intand&strarguments to the include file. Because the parameters are named, their order is unimportant. The called procedure can find each argument, regardless of placement. Ther-inc.iinclude file displays a message that consists of the passed arguments. The asterisk argument displays all the parameters as they are listed in ther-inc.pprocedure:
Notes
- If you pass {} arguments using the RUN statement, you cannot precompile the called procedure. When Progress compiles a procedure, it must have all the values the procedure needs. So, if you pass arguments to a procedure you are calling with the RUN statement, Progress evaluates those arguments when the calling procedure is run, not when it is compiled.
- You can use the name of an include file as an argument to another include file. For example, a reference to {{1}} in an included procedure causes Progress to include the statements from the file with the name that passed as the first argument.
- Use DEFINE PARAMETER to define a run-time parameter in a called subprocedure. Each parameter requires its own DEFINE statement. The parameters must be specified in the RUN statement in the same order as defined with DEFINE statements.
- Progress disregards an empty pair of braces ({}).
- The maximum length of the arguments you can pass to an include file is determined by the Input Characters (-inp) startup parameter.
- An argument
argument-namebehaves like a scoped preprocessor name. Thus, if you define a preprocessor name,argument-name, its value replaces the value of any argumentargument-namepassed to the same file at the point where the preprocessor name,argument-name, is defined.See also
; Special character, { } Include file reference, { } Preprocessor name reference, COMPILE statement, DEFINE PARAMETER statement, RUN statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |